1. Field of the Invention
The present invention relates to an inspection method and apparatus and, more particularly, to an inspection method and apparatus for inspecting the formation state of a pattern on an object on which repetitive patterns are formed.
2. Description of the Related Art
In the manufacturing processes of semiconductor devices, liquid crystal display devices, and the like, circuit patterns and the like are formed sequentially on a substrate such as a wafer or a glass plate (to be referred to as a xe2x80x9csubstratexe2x80x9d or xe2x80x9cwaferxe2x80x9d hereinafter as needed). And an inspection apparatus for checking the formation state of the patterns is used in a predetermined step in the manufacturing process. As such inspection apparatus, an optical image inspection apparatus using light such as a laser beam, and an electron image inspection apparatus such as a scanning microscope using an electron beam have been put into practical use.
On the substrate of the semiconductor device or the like, identical patterns are periodically formed in each unit of so-called shot area. In a memory device or a liquid crystal display device, an identical pattern is periodically formed even in a single shot area.
As a technique for detecting any foreign matter or pattern defects (to be referred to as xe2x80x9cpattern defectsxe2x80x9d hereinafter) on the substrate surface on which periodic repetitive patterns must be formed, a technique for comparing a raw image which is an optical or electron image obtained by the inspection apparatus and a shift image obtained by shifting the raw image by the repetition pitch (to be referred to as a xe2x80x9cneighbor comparison methodxe2x80x9d hereinafter) has been proposed. And the neighbor comparison method is prevalently used as the inspection method of the formation state of periodic patterns. In such neighbor comparison method, a binary image having the number of gray level=2 is conventionally used, but a gray image with 3 or more gray level or continuous gray level (to be referred to as a xe2x80x9cmulti-gray level imagexe2x80x9d hereinafter) is often used today. In the neighbor comparison method, pattern defects or the like are estimated to be present at an image position where the difference value as a comparison result becomes equal to or larger than a predetermined value (threshold value).
As described above, in the conventional neighbor comparison method, actually formed patterns are compared. The actually formed patterns inevitably include errors from an expectation pattern which is to be originally formed upon pattern formation. For this reason, even when the difference between the signal levels (gray levels) of the raw and shift images at their identical positions is small, the differences between each signal level of the two images and the signal level (to be referred to as an xe2x80x9cexpectation levelxe2x80x9d hereinafter) of the expectation pattern are not always small. Even when the difference between the signal levels (gray levels) of the raw and shift images at their identical positions is large, the differences between each signal level of the two images and the expectation level are not always large.
That is, according to the conventional neighbor comparison method, even when the signal level at each image position has a large difference from the expectation level, pattern defects or the like are often not estimated to be present. In this case, even when pattern defects are present, they cannot be recognized. On the other hand, even when the signal level at each image position is not largely different from the expectation level, pattern defects are estimated to be present. In this case, even when no pattern defects are present, a false detection of the pattern defects occurs.
As described above, a multi-gray level image is prevalently used, and the difference between the signal levels at each image position is used, but binary information indicating whether or not the xe2x80x9cdifferencexe2x80x9d value is larger than a threshold value is merely obtained. That is, only basically the same information as that obtained using a binary image is obtained. For this reason, although a multi-gray level image is used, information included in the xe2x80x9cdifferencexe2x80x9d value is not always fully utilized. That is, a technique for accurately inspecting the substrate surface, on which periodic repetitive patterns are to be formed, for pattern defects by fully utilizing information obtained by a multi-gray level image is demanded.
The present invention has been made in consideration of the above situation, and has as its object to provide an inspection method and apparatus which can accurately inspect the formation state of periodic repetitive patterns on an object.
According to the first aspect of the present invention, there is provided an inspection method for inspecting an object on which a specific pattern is periodically and repetitively formed along a predetermined direction, comprising the steps of: picking-up an image of the object using not less than three gray levels; and obtaining formation information of the specific pattern by statistically analyzing a difference between a raw image obtained as an image pick-up result obtained in the image picking-up step, and a reference image.
According to this method, since the difference between the raw image which is an image pick-up result of an object picked-up as multi-gray level data, and the reference image is statistically analyzed to obtain the formation information of the specific pattern, the formation information of the specific pattern can be obtained by effectively using information contained in the multi-gray level image. Hence, the formation state of periodic repetitive patterns on the object can be accurately inspected.
In the inspection method of the present invention, the step of obtaining the formation information comprises: generating data points, which are defined at as data sets of gray levels at identical positions in said raw and reference images, in a coordinate space which has coordinate axes corresponding to values of the gray levels in said raw and reference images; and obtaining pattern formation information, based on a distribution of said data points in said coordinate space.
In the inspection method of the present invention, upon obtaining the formation information, (Nxe2x88x921) (N is an integer equal to or larger than 2) shift images are obtained by shifting the raw image obtained as the image pick-up result in the image pick-up step by integer multiples of a repetition period in a repetition direction of the specific pattern in the image pick-up result; sets of gray levels at identical positions in N images including the raw image and (Nxe2x88x921) shift images are defined as data points, and data points corresponding to positions in overlapping regions of the N images are plotted in an N-dimensional coordinate space; and pattern formation information of the object is obtained on the basis of a state of a distribution of the data points in the N-dimensional coordinate space.
In such case, based on the raw image which is obtained by picking-up the object and has three or more gray levels, (Nxe2x88x921) shift images are obtained by shifting the raw image in the repetition direction by integer multiples of the repetition period of the specific pattern. Sets of gray levels at identical positions of N images consisting of the raw image and (Nxe2x88x921) shift images are defined as data points in the N-dimensional coordinate space, and data points at respectively positions in overlapping regions of the N images are plotted in the N-dimensional coordinate space.
The plotted data points are distributed around a straight line or a curve (to be generally referred to as an xe2x80x9cexpectation linexe2x80x9d hereinafter) formed by a set of data points of those similarly plotted in an expectation pattern (to be referred to as xe2x80x9cexpectation data pointsxe2x80x9d hereinafter). When, for example, repetitive patterns formed are exactly the same, and are expected to be simultaneously picked up under identical conditions, the expectation line as a set of expectation data agrees with a straight line (to be referred to as a xe2x80x9creference linexe2x80x9d hereinafter) which is a set of points having identical coordinate values in the N-dimensional coordinate. In such data point distribution, if a region of pattern defects is only a portion of the overall region, most of errors from the expectation line are probably contingency errors. That is, most of errors from the expectation line are considered as accidental events.
Therefore, by statistically analyzing the data point distribution state in the N-dimensional coordinate space as a probably distribution, pattern formation information that pertains to pattern defects on the object can be obtained. The N-dimensional coordinate position of a data point completely reflects multi-gray level information at respective points of the multi-gray level images, and the pattern formation information based on the relationship between the expectation pattern and image pick-up result is obtained in practice by analyzing a distribution around points on the expectation line as maximum likelihood estimates, thus accurately inspecting the pattern formation state of the object.
Upon obtaining the shift image, the repetition direction and period in the image pick-up result are obtained by analyzing the raw image; and the (Nxe2x88x921) shift images are obtained using the obtained repetition direction and period.
Also, upon obtaining the formation information, an Nth-order joint probability density function is estimated from the distribution of the data points in the N-dimensional coordinate space, and a reference occurrence frequency at each coordinate position in the N-dimensional coordinate space is computed using the Nth-order joint probability density function; a relationship between the reference occurrence frequency and an actual occurrence frequency at each coordinate position in the N-dimensional coordinate space is computed; and the pattern formation information of the object is obtained on the basis of the computed relationship.
In this case, the reference occurrence frequency can be used as an expectation value of a occurrence frequency at each coordinate position in the N-dimensional coordinate space when the Nth-order joint probability density function is used; and the relationship between the reference and the actual occurrence frequencies can use ratio between the reference and actual occurrence frequencies. That is, the expectation value of the occurrence frequency as a maximum likelihood estimate at each coordinate position when the estimated Nth-order joint probability density function is used is defined as a reference occurrence frequency. When the ratio of the actual occurrence frequency to the reference occurrence frequency falls within a predetermined range, no pattern defects are estimated to be present; and when the ratio of the actual occurrence frequency to the reference occurrence frequency falls outside the predetermined range, pattern defects are estimated to be present.
The reference occurrence frequency can be used as at least one of upper and lower limit values of a confidence interval according to a predetermined statistical confidence, which pertains to an expectation value of a occurrence frequency at each coordinate position in the N-dimensional coordinate space when the Nth-order joint probability density function is used, and the relationship between the reference and actual occurrence frequencies can be use difference between the reference and actual occurrence frequencies. In such case, the respective amount of the reference and actual occurrence frequencies are compared using the reference occurrence frequency as at least one of the upper and lower limit values of the confidence interval according to the predetermined statistical confidence, which pertains to the expectation value of the occurrence frequency as the maximum likelihood estimate at each coordinate position upon using the estimated Nth-order joint probability density function. For example, if the reference occurrence frequencies define the upper and lower limit values of the confidence interval and the actual occurrence frequency falls within the confidence interval, no pattern defects are estimated to be present; if the actual occurrence frequency falls outside the confidence interval, pattern defects are estimated to be present. If a coordinate position where the actual occurrence frequency is larger than the upper limit value of the confidence interval is found, pattern defects are estimated to be present, and the data points at that coordinate position include a data point according to the pattern defects. On the other hand, if a coordinate position where the actual occurrence frequency is smaller than the lower limit value of the confidence interval is found, it is estimated that a coordinate position including a data point according to actual pattern defects cannot be specified but some pattern defects are present anywhere else.
In the inspection method of the present invention using the confidence interval, the confidence interval can be obtained under the assumption that the probability of occurrence at each coordinate position in the N-dimensional coordinate space complies with a binomial distribution which uses the expectation value as an average value. When the number of data points is sufficiently large, the confidence interval can be obtained under the assumption that the probability of occurrence at each coordinate position in the N-dimensional coordinate space complies with a Poisson distribution which uses the expectation value as an average value.
In the inspection method of the present invention using the Nth-order joint probability density function, the Nth-order joint probability density function can be estimated as a mixture of a plurality of N-dimensional normal distribution type probability density functions. In this manner, it is particularly effective to estimate the Nth-order joint probability density function as a mixture of a plurality of N-dimensional normal distribution type probability density functions, when the distribution of errors of data points from expectation data points complies with a normal distribution type. When the probability density functions of errors of data points are known, they can be used. On the other hand, when the probability density functions of errors of data points are unknown, it is rational to estimate the normal distribution type, which is a most prevalent probability density function, as the Nth-order joint probability density function.
Note that the Nth-order joint probability density function can be estimated by dividing the N-dimensional coordinate space into a plurality of partial spaces by at least one (Nxe2x88x921)-dimensional plane which is perpendicular to a reference line as a set of points having equal coordinate values in the N-dimensional coordinate space; estimating N-dimensional normal distribution type probability density functions in units of partial spaces from the data points in each of the partial spaces; and computing a weighted sum of the N-dimensional normal distribution type probability density functions in units of partial spaces depending on the corresponding numbers of data points.
In such case, when the overall data point distribution is formed around a plurality of expectation data points present on the expectation line, the N-dimensional coordinate space is divided into a plurality of appropriate partial spaces each including one expectation data point, thus estimating the N-dimensional normal distribution type probability density function of each partial space. It is desirable to divide the coordinate space into a plurality of partial spaces on (Nxe2x88x921)-dimensional planes perpendicular to the expectation line. But (a) the expectation line is unknown and (b) the expectation line nearly agrees with the reference line since each repetitive pattern is picked up under substantially the same image pick-up condition. For these reasons, the N-dimensional coordinate space is divided by (Nxe2x88x921)-dimensional planes perpendicular to the reference line as a set of points with equal coordinate values in the N-dimensional coordinate space.
By computing the sum of N-dimensional normal distribution type probability density functions of the individual partial spaces, which are weighted depending on the numbers of corresponding data points, the N-dimensional normal distribution type probability density function of the entire data point distribution is computed. As a result, the N-dimensional normal distribution type probability density function of the entire data point distribution can be accurately estimated with a smaller computation volume than upon computing it at once using all data points.
Note that the N-dimensional normal distribution type probability density functions corresponding to the plurality of partial spaces can be estimated as Nth-order joint probability density functions having centers on the reference line for the aforementioned reasons (a) and (b) In this case, although the estimation accuracy drops slightly, the computation volume can be further reduced.
The N-dimensional coordinate space can be divided into the plurality of partial spaces to maximize the likelihood of the Nth-order joint probability density function estimated for each of the plurality of partial spaces as a whole.
The Nth-order joint probability density function can be estimated by dividing the N-dimensional coordinate space into a plurality of partial spaces by a plurality of (Nxe2x88x921)-dimensional planes which are perpendicular to a reference line as a set of points having equal coordinate values in the N-dimensional coordinate space; mapping the data points in the plurality of partial spaces onto the (Nxe2x88x921)-dimensional planes perpendicular to the reference line; computing (Nxe2x88x921)-dimensional normal distribution type probability density functions for the plurality of partial spaces on the basis of the distributions of the mapped data points on the (Nxe2x88x921)-dimensional planes; and computing a weighted sum of the N-dimensional normal distribution type probability density functions depending on the corresponding numbers of data points. In such case, since the joint probability density function is computed not as the N-dimensional normal distribution type probability density function but as the (Nxe2x88x921)-dimensional normal distribution type probability density function, the computation volume can be reduced although the estimation accuracy generally lowers. When the data point distribution in each partial space is nearly cylinder-symmetric to have the reference line as the central line, since the computation volume can be greatly reduced while maintaining high estimation accuracy of the Nth-order joint probability density function of the entire data point distribution, the formation state of repetitive patterns on the object can be inspected very quickly while maintaining high inspection accuracy.
In the inspection method of the present invention, upon obtaining the formation information, a first probability density function which pertains to occurrence probabilities of relationship data is estimated on the basis of a distribution of the relationship data of gray levels in the raw image obtained as the image pick-up result in the image pick-up step and the reference image at identical positions; a second probability density function that pertains to occurrence frequencies of individual values of the relationship data is estimated under an assumption that a probability distribution of the relationship data complies with the first probability density function, and estimating reference occurrence frequencies of the individual values of the relationship data; abnormal relationship data candidates which are estimated to be abnormal relationship data, which have occurrence frequencies in the distribution of the relationship data that do not comply with the first probability density function at a predetermined confidence, are extracted on the basis of the second probability density function, the reference occurrence frequencies, and occurrence frequencies of the individual values of the relationship data in the distribution of the relationship data; and a first probability that each of the abnormal relationship data candidate is the abnormal relationship data is estimated.
With this, using a raw image having three or more gray levels obtained by picking-up an object in the image pick-up step, relationship data (e.g., the difference, ratio, and the like of gray levels at identical positions of the raw and reference images) of gray levels at identical positions of the raw and reference images are obtained. The distribution of such relationship data results from formation errors of patterns since a region of pattern defects is normally only a portion of the overall region. Most generations of relationship data are considered as probability phenomena. Hence, by considering generations of relationship data as probability phenomena, a first probability density function that pertains to probabilities of occurrence of relationship data is estimated. Subsequently, reference occurrence frequencies of respective relationship data values are estimated by estimating a second probability density function that pertains to the occurrence frequencies of relationship data in respective relationship data values, when the probability distribution of the relationship data complies with the first probability density function, i.e., when maximum likelihood estimates of probabilities of occurrence of relationship data values are obtained by the first probability density function.
Then, abnormal relationship data candidates which are estimated to be abnormal relationship data, in which the occurrence frequencies in the relationship data distribution do not comply with the first probability density function with a predetermined confidence, are extracted on the basis of the estimation result in the second estimation step and the occurrence frequencies of relationship data values in the relationship data distribution. After the abnormal relationship data candidates are extracted, the probability that each abnormal relationship data candidate is abnormal relationship data (to be referred to as an xe2x80x9cabnormal probabilityxe2x80x9d hereinafter) is computed in the abnormal probability computation step.
The abnormal probability is statistically appropriate since it is computed by executing statistical processes on the basis of raw image data obtained by image picking-up. Hence, pattern defects can be logically found by checking based on the abnormal probability if each abnormal relationship data candidate is abnormal relationship data that reflects pattern defects. For this reason, the formation state of periodic repetitive patterns on the object can be accurately inspected.
Also, upon checking if each abnormal relationship data candidate is abnormal relationship data, since raw image data is processed as multi-valued data without executing binarization immediately after the difference between the raw and shift images is computed unlike in the prior art, so-called rounding errors generated by arithmetic processes after binarization can be prevented from being accumulated, and whether or not each abnormal relationship data candidate is abnormal relationship data can be accurately checked.
As described above, the relationship data can use one of a difference and ratio between pixels in the raw and reference images, as described above. Either the difference or ratio can be used as relationship data which is used to accurately find any pattern defects.
The reference image can be either a predetermined image or a shift image obtained by shifting the raw image by an integer multiple of a repetition period in a repetition direction of the specific pattern in the image pick-up result. When the shift image is used, a product of the first probability and a second probability that relationship data which pertains to a position in the shift image corresponding to the position of the abnormal relationship data candidate in the raw image is the abnormal relationship data is computed; and appropriateness of determining that the abnormal relationship data candidate is the abnormal relationship data is evaluated based on the probability product.
In such case, after the abnormal probability of the abnormal relationship data candidates is computed as described above, the product of that probability and the abnormal probability of relationship data associated with the position in the shift image corresponding to the position of the abnormal relationship data candidate in the raw image is computed in the probability product computation step. Whether or not each abnormal relationship data candidate is abnormal relationship data is checked based on the computed product value in the evaluation step. That is, if the abnormal probability product value associated with a given abnormal relationship data candidate is larger than a predetermined threshold value, it is determined that the abnormal relationship data candidate is abnormal relationship data; if the abnormal probability product value associated with a given abnormal relationship data candidate is equal to or smaller than the predetermined threshold value, it is determined that the abnormal relationship data candidate is not abnormal relationship data. As a result, when both the abnormal relationship data candidate and the abnormal probability of its corresponding relationship data are large to some extent, i.e., when it is regarded that pattern defects are reflected in both the abnormal relationship data candidate and its corresponding relationship data, it is determined that the abnormal relationship data candidate is abnormal relationship data. Hence, the positions of pattern defects upon duplicated generation of abnormal relationship data candidates associated with a pixel corresponding to the pattern defects, which inevitably occurs since the reference image is used as a shift image, can be prevented from being additionally recognized. Therefore, the formation state of periodic repetitive pattern on the object can be accurately inspected.
The reference image can use at least one shift image obtained by shifting the raw image in the repetition direction in the image pick-up result by an integer multiple of the repetition period, and the relationship data can use vector data having as components gray levels at identical positions in the raw image and at least one shift image. Even in such case, the vector data as the relationship data is multi-valued data that completely reflects multi-gray level information at each point of a multi-gray level image, abnormal relationship data candidates are extracted by statistically processing the distribution of such multi-valued data, and the abnormal probabilities of the abnormal relationship data candidates are computed. Therefore, statistically appropriate abnormal probabilities can be obtained while preventing so-called rounding errors produced by arithmetic processes after binarization.
When the reference image is used as a shift image, the shift image can be obtained using the repetition direction and period in the image pick-up result obtained by analyzing the raw image.
Also, the first probability function can be estimated as a normal distribution type probability density function. In this way, it is particularly effective to estimate the first probability density function as a normal distribution type probability density function when the distribution of errors complies with a normal distribution. When the probability density function of errors is known, it can be used. On the other hand, when the probability density function of errors is unknown, it is rational to estimate it as a normal distribution type probability density function, which is the most prevalent probability density function.
An upper limit value of a confidence interval corresponding to a predetermined statistic confidence based on the second probability density function can be obtained as the reference occurrence frequency, and the abnormal relationship data candidates can be extracted in the extraction step on the basis of the reference occurrence frequencies and the occurrence frequencies of individual values of the relationship data. In such case, relationship data having a relationship data value, the actual occurrence frequency of which has exceeded the upper limit value of the confidence interval of the occurrence frequencies obtained from the second probability density function, is extracted as an abnormal relationship data candidate. Therefore, abnormal relationship data can be statistically logically extracted.
When the relationship data value has an actual occurrence frequency which is lower than the lower limit value of the confidence interval, it is estimated that pattern defects are present somewhere. In this case, it is not estimated that abnormal relationship data is included in relationship data having that relationship data value, but it is merely estimated that pattern defects are present somewhere the entire image. For this reason, upon detecting the relationship data value having an actual occurrence frequency which is lower than the lower limit value of the confidence interval, abnormal relationship data candidates are inhibited from being extracted.
In this case, the second probability density function can be estimated as one of a binomial distribution probability density function and a Poisson distribution probability density function. If the number of relationship data is sufficiently large, the second probability density function can be estimated to comply with a Poisson distribution which has as an average value the occurrence frequency when the first probability density function is a maximum likelihood estimate of the probability of occurrence of each relationship data value. If the number of relationship data is not sufficiently large, the second probability density function can be estimated to comply with a binomial distribution when the first probability density function is a maximum likelihood estimate of the probability of occurrence of each relationship data value.
Note that the formation position of a specific pattern on the object to be inspected is not particularly limited. But when the specific pattern is formed on the surface of the object, the formation state of periodic repetitive patterns on the object can be accurately inspected using image data obtained by a normal image pick-up unit.
According to the second aspect of the present invention, there is provided an inspection apparatus for inspecting an object on which a specific pattern is periodically and repetitively formed along a predetermined direction, comprising: an image pick-up unit for picking-up an image of the object using not less than three gray levels; and a statistical processing unit for obtaining formation information of the specific pattern by statistically analyzing a difference between a raw image of an image pick-up result obtained by the image pick-up unit, and a reference image.
According to this apparatus, since the statistical processing unit statistically analyzes the difference between the raw image as the image pick-up result of the object which is picked up as multi-gray level data by the image pick-up unit, and the reference image so as to obtain the formation information of the specific pattern, the formation information of the specific pattern is obtained by effectively utilizing information contained in the multi-gray level image. Hence, the formation state of periodic repetitive patterns on the object can be accurately detected.
In the inspection apparatus of the present invention, the statistical processing unit can comprise: an image shift unit for obtaining (Nxe2x88x921) shift images by shifting the raw image as the image pick-up result obtained by the image pick-up unit by integer multiples of a repetition period in a repetition direction of the specific pattern in the image pick-up result; and a pattern formation information arithmetic unit for defining as data point sets of gray levels at identical positions in N images including the raw image and (Nxe2x88x921) shift images, plotting data points corresponding to positions in overlapping regions of the N images in an N-dimensional coordinate space, and obtaining pattern formation information of the object on the basis of a state of a distribution of the data points in the N-dimensional coordinate space.
In such case, the image shift unit obtains (Nxe2x88x921) shift images by shifting the raw image by integer multiples of the repetition period in the repetition direction of the specific pattern on the basis of the raw image obtained by the image pick-up unit and having three or more gray levels. The pattern formation information arithmetic unit defines sets of gray levels at identical positions of N images consisting of the raw image and (Nxe2x88x921) shift images as data points in the N-dimensional coordinate space, plots data points at respectively positions in an overlapping region of the N images in the N-dimensional coordinate space, and obtains the pattern formation information of the object from the state of the data point distribution in the N-dimensional coordinate space.
The image shift unit can comprise: a repetition information computation unit for obtaining the repetition direction and period in the image pick-up result by analyzing the raw image; and a shift computation unit for obtaining the (Nxe2x88x921) shift images using the repetition direction and period obtained by the repetition information arithmetic unit.
The pattern formation information computation unit can comprise: a reference frequency arithmetic unit for estimating an Nth-order joint probability density function from the distribution of the data points in the N-dimensional coordinate space, and computing a reference occurrence frequency at each coordinate position in the N-dimensional coordinate space using the Nth-order joint probability density function; and a pattern formation information arithmetic unit for computing a ratio between the reference occurrence frequency and an actual occurrence frequency at each coordinate position in the N-dimensional coordinate space, and obtaining the pattern formation information of the object on the basis of the computed ratio.
In the inspection apparatus of the present invention, the pattern formation information computation unit can obtain confidence information indicating if the specific pattern information is formed on each of formation regions of the specific pattern on the object as the pattern formation information of the object.
The apparatus can further comprise a defect position arithmetic unit for obtaining a candidate position of at least one of foreign matter and a pattern defect on the object on the basis of the confidence information obtained by the pattern formation information arithmetic unit and positions on the object of the data points plotted in the N-dimensional coordinate space.
In the inspection apparatus of the present invention, the statistical processing unit can comprise: an estimation unit for estimating a first probability density function which pertains to occurrence probabilities of relationship data on the basis of a distribution of the relationship data of gray levels in the raw image obtained as the image pick-up result by the image pick-up unit and the reference image at identical positions, estimating a second probability density function that pertains to occurrence frequencies of the relationship data of individual values of the relationship data under an assumption that a probability distribution of the relationship data complies with the first probability density function, and estimating reference occurrence frequencies of the individual values of the relationship data; an extraction unit for extracting abnormal relationship data candidates which are estimated to be abnormal relationship data, which have occurrence frequencies in the distribution of the relationship data that do not comply with the first probability density function at a predetermined confidence, on the basis of the estimation results of the estimation unit and occurrence frequencies of the individual values of the relationship data in the distribution of the relationship data; and an abnormal probability computation unit for computing a first probability that each of the abnormal relationship data candidate is the abnormal relationship data.
In such case, the estimation unit estimates a first probability density function that pertains to occurrence probabilities of relationship data by obtaining relationship data of gray levels in the raw and reference images at identical positions using the raw image having three or more gray levels obtained by the image pick-up unit, and estimates a second probability density function that pertains to the occurrence frequencies of relationship data in respective relationship data values, when the probability distribution of the relationship data complies with the first probability density function. Subsequently, the extraction unit extracts abnormal relationship data candidates which are estimated to be abnormal relationship data, in which the occurrence frequencies in the relationship data distribution do not comply with the first probability density function with a predetermined confidence. The abnormal probability computation unit then computes abnormal probabilities of the abnormal relationship data candidates. Hence, pattern defects can be accurately inspected.
Note that the reference image is a shift image obtained by shifting the raw image by an integer multiple of a repetition period in a repetition direction of the specific pattern in the image pick-up result, and the apparatus can further comprise an image shift unit for obtaining the shift image by shifting the raw image by an integer multiple of the repetition period in the repetition direction; a probability product computation unit for computing a probability product of the first probability and a second probability that relationship data which pertains to a position in the shift image corresponding to the position of the abnormal relationship data candidate in the raw image is the abnormal relationship data; and an evaluation unit for evaluating based on the probability product appropriateness that the abnormal relationship data candidate is the abnormal relationship data.
When the reference image is used as a shift image, the image shift unit can comprise: a repetition information computation unit for computing the repetition direction and period in the image pick-up result by analyzing the raw image; and a shift computation unit for obtaining the shift image using the repetition direction and period obtained by the repetition information computation unit.